package com.taplinker.client.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

import com.taplinker.client.im.db.DatabaseHelper;

/**
 * 会话数据库
 * @author djbian
 *
 */
public class ConversationDBHelper extends DatabaseHelper {
	
	private final String DB_CONVERSATION_SQL = "CREATE TABLE [conversation]"
			+ "([conversationId] [VARCHAR2(200)],"
			+ "[visitorId] [VARCHAR(20)],"
			+ "[source] [VARCHAR(200)],"
			+ "[productId] [VARCHAR(200)],"
			+ "[unreadCount] INT DEFAULT 0,"
			+ "[sourceDesc] TEXT,"
			+ "[location] [VARCHAR(200)],"
			+ "[remark] TEXT,"
			+ "[lastMessage] TEXT,"
			+ "[updateTime] INT64,"
			+ "[lastMessageType] [VARCHAR(200)]"
			+ "[status] [VARCHAR(200)]);";

	public ConversationDBHelper(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(DB_CONVERSATION_SQL);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	}
	
}
